package com.doctcloud.hisinfo.histable.domain.comm;

import com.baomidou.mybatisplus.annotation.TableName;
import com.doctcloud.common.core.annotation.Excel;
import com.doctcloud.common.core.annotation.TableDesc;
import com.doctcloud.common.core.web.domain.BaseCharsetEntity;
import lombok.*;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

import static com.doctcloud.common.core.utils.StringUtils.trim;

@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = {"sexName"})
@ToString
@Data
@TableDesc("性别字典")
//public class SexDictDo extends BaseCharsetEntity {
public class SexDictDo implements Serializable {
    private static final long serialVersionUID = 1L;
    @NotNull
    @Excel(name = "序号")
    private Integer serialNo;
    @Excel(name = "性别代码")
    private String sexCode;
    @Excel(name = "性别名称")
    private String sexName;
    @Excel(name = "输入码")
    private String inputCode;

    @Data
    public static class primaryKey {
        private final String sexName;
        public primaryKey(String sexName) {
            this.sexName = sexName;
        }
    }

//    public String getSexName() {
//        return super.processGet(sexName);
//    }
//
//    public void setSexName(String sexName) {
//        this.sexName = super.processSet(sexName);
//    }

    public void setSexCode(String sexCode) {
        this.sexCode = trim(sexCode);
    }

    public void setSexName(String sexName) {
        this.sexName = trim(sexName);
    }

    public void setInputCode(String inputCode) {
        this.inputCode = trim(inputCode);
    }
}
